import axios from "axios";

const http = axios.create({
  baseURL: "http://81.71.154.114:8989", //https://show.cool-admin.com/,
  headers: {
    "X-Requested-With": "XMLHttpRequest",
  },
  withCredentials: false,
})

http.interceptors.request.use((config) => {
  config.headers['Authorization'] = localStorage.getItem("accessToken");
  console.log("token", localStorage.getItem("accessToken"));

  return config;
}, (err) => {
  return Promise.reject(err);
})

http.interceptors.response.use((response) => {
  return response
}, (err) => {
  return Promise.reject(err);
})

export default http;


